from django.conf.urls.defaults import *
from podcasts.feeds import PodcastFeed
from podcasts.models import *

feeds = {
	'episodes': PodcastFeed
}

podcasts = {
	'queryset': Podcast.on_site.public(),
	'slug_field': 'slug',
	'template_object_name': 'podcast',
}

episodes = {
	'queryset': Episode.on_site.published(),
	'template_object_name': 'episode',
}

urlpatterns = patterns('',
	url(r'^(?P<slug>[-\w]+)/$', 'django.views.generic.list_detail.object_detail', podcasts, name="podcast_detail"),
	url(r'^episodes/(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_detail', episodes, name="episode_detail"),
	url(r'^(?P<url>.*).xml$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}, name="podcast_feed"),
)